package org.codeart.memento.example02;

import java.util.ArrayList;

/**
 * 备份玩家的状态
 */
public class Memento {

    private int money;
    
    private ArrayList<String> fruits;

    public Memento(int money) {
        this.money = money;
        this.fruits = new ArrayList<>();
    }

    public int getMoney() {
        return money;
    }

    public ArrayList<String> getFruits() {
        return (ArrayList<String>) fruits.clone();
    }
    
    public void addFruit(String fruit) {
        fruits.add(fruit);
    }
}
